/*直接更新state的多个方法的对象*/

import {RECEIVE_ADDRESS,RECEIVE_CATEGORIES,RECEIVE_SHOPS,RECEIVE_USER_INFO,RESET_USER_INFO} from './mutation-types'
export default {

  [RECEIVE_ADDRESS](state,{address}){ //actions和mutations交互的时候传的是包含数据的对象，{address}是传包含数据的对象，不能直接传address
    state.address = address
  },
  [RECEIVE_CATEGORIES](state,categorys){
    state.categorys = categorys
  },
  [RECEIVE_SHOPS](state,shops){
    state.shops = shops
  },
  [RECEIVE_USER_INFO](state,userInfo) {
    state.userInfo = userInfo
  },
  [RESET_USER_INFO](state){
    state.userInfo = {}
  }
}
